package com.mpyy.handler.statistical;

import com.alibaba.fastjson.JSON;
import com.mpyy.pojo.InventoryDesc;
import com.mpyy.service.statistical.InventorCostInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;

/**
 * @PackageName:com.mpyy.handler.statistical
 * @ClassName:InventoryCost
 * @Date:2022-02-28:10:39
 * @Author: Tang Neng
 */
@Controller
public class InventoryCostHandler {
    @Autowired
    private InventorCostInter inventorCostInter;

    @RequestMapping(value = {"/searchInventoryCostInfo"})
    @ResponseBody
    public String searchInventoryCostInfo(){
        System.out.println("调用查询方法");
        List<InventoryDesc> inventoryDescs = inventorCostInter.searchInventorCostInfo();

        HashMap<Object, Object> objectHashMap = new HashMap<>();
        objectHashMap.put("code",0);
        objectHashMap.put("msg","");
        objectHashMap.put("count",inventoryDescs.size());
        objectHashMap.put("data",inventoryDescs);
        return JSON.toJSONString(objectHashMap);
    }
}
